import http from "../http.ts"
import sha256 from "crypto-js/sha256";
import request from "../request.ts"


export const login = (data) => {
	return http.post("/userCred/login", data, {
		msg: false,
		token:false,
		load:true
	})
}
// return request({
// 	url: "/userCred/login",
// 	method: "POST",
// 	data: data,
// 	httpOptions: {
// 		msg: false,
// 		token:false,
// 		load:true
// 	}
// })

export const register = (data) => {
	data.password = sha256(data.password) + ""
	return request({
		url: "/userCred/register",
		method: "POST",
		data: data,
		httpOptions: {
			msg: false,
			token:false,
			load:true
		}
	})
}

export const captcha = () => {
	return request({
		url: "/userCred/getCaptcha",
		method: "GET",
		httpOptions: {
			msg: false,
			token: false,
			load:false
		}
	})
}
